module AluControl(
input [5:0] Opcode, //pa la add inmediata
input [1:0] ALUOp, 
input [5:0] Funct, 
output reg [3:0]Operacion
);

parameter [1:0] DATATRANSFER = 00,
                BRANCH= 2'b 01,
                REGISTER = 2'b 10,
                IMMEDIATE = 2'b 11;

always @ (*) 
  begin
   Operacion = 4'h 2;
   case (ALUOp)
    DATATRANSFER: Operacion = 4'h 2;  //suma
    REGISTER: case (Funct)
                    6'h 20: Operacion = 4'h 2; //R-type add
                    6'h 19: Operacion = 4'h 5; //R-type Multi
                    6'h 22: Operacion = 4'h 6; //R-type subtract
                    6'h 24: Operacion = 4'h 0; //R-type and
                    6'h 25: Operacion = 4'h 1; //R-type or
                    6'h 2A: Operacion = 4'h 7; //R-type set on less than
                    6'h 26: Operacion = 4'h 3; //R-type xor
                    6'h 27: Operacion = 4'h E; //R-type shift right
                    6'h 2E: Operacion = 4'h F; //R-type shift left
					   default: 
                          Operacion = 4'h x;
            endcase                                
    BRANCH: Operacion = 4'h 6; //resta
    IMMEDIATE: begin if (Opcode==4'h7) Operacion = 4'h 2; end
    default :
      Operacion = 4'h x;
    endcase
end
endmodule